package org.example.pinda.database.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
@ConfigurationProperties(prefix = "pinda.database")
public class DatabaseProperties {
    /**
     * 事务超时时间
     */
    private int txTimeout = 60 * 60;

    private List<String> transactionAttributes = new ArrayList<>(
            Arrays.asList(
                    "add*", "save*", "insert*", "create*", "update*", "edit*",
                    "upload*", "delete*", "remove*", "clean*", "recycle*",
                    "batch*", "mark*", "disable*", "enable*", "handle*",
                    "syn*", "reg*", "gen*", "*Tx"
            )
    );

    private String transactionScanPackage = "org.example.pinda";

    private Boolean isBlockAttack = false;
}
